'use client';
import { GradeSelectControl } from '@/data/modules/grade/control';
import SchoolClassControl from '@/data/modules/schoolClass/control';
import { SchoolClass } from '@/data/prisma';
import { Splitter } from 'antd';
import { Suspense, useState } from 'react';

export default function Page() {
	const [refData, setRefData] = useState<Partial<SchoolClass>>();
	return <Suspense fallback={<div>数据加载中...</div>}>
      <Splitter layout='horizontal'>
				<Splitter.Panel size={300}>
					<GradeSelectControl onSelectRow={(row) => {
						setRefData({ gradeId: row.id });
					}}/>
				</Splitter.Panel>
				<Splitter.Panel>
					{refData && <SchoolClassControl refData={refData}/>}		
				</Splitter.Panel>
			</Splitter>  
    </Suspense>
};